﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Pay.Data {
	public partial class MerchantRegisterMap
		: System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<MerchantRegister> {
		public MerchantRegisterMap() {
			// table
			ToTable("mc_MerchantRegister", "dbo");

			// keys
			HasKey(t => t.Id);

			// Properties
			Property(t => t.Id)
				.HasColumnName("Id")
				.HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
				.IsRequired();
			Property(t => t.MerchantId)
				.HasColumnName("MerchantId")
				.IsRequired();
			Property(t => t.IsSuccess)
				.HasColumnName("IsSuccess")
				.IsRequired();

			// Relationships
			HasRequired(t => t.Merchant)
				.WithMany()
				.HasForeignKey(d => d.MerchantId)
				.WillCascadeOnDelete(false);
		}
	}
}
